Add nginx configuration for WordPress subdirectory setup#426
Conversation
kittenkamala
left a comment
There was a problem hiding this comment.
Looks good! Is there a reason to use php 8.1 in here instead of 8.3 (which is WP.org's official recommendation) ?
|
I'm using 8.1 on my machine thus I use it there 😅, I'll update that to 8.3 |
|
Hi @kittenkamala - updated the PHP into 8.3 ^^ |
| </IfModule> | ||
| ``` | ||
|
|
||
| ### nginx (server block) |
There was a problem hiding this comment.
I wonder if we could link to https://developer.wordpress.org/advanced-administration/server/web-server/nginx/ instead of maintaining multiple copies of this server config?
There was a problem hiding this comment.
I think we should link for more information, but that page is far weedier than this block, so I would vote for keeping it here as a quick reference.
jazzsequence
left a comment
There was a problem hiding this comment.
This lgtm. I think because the Nginx examples called out by @mindctrl are more limited / specific than the linked configuration in the Developer Handbook, it's worth linking out to those pages, but I think having the configuration here makes sense as these code blocks are a lot smaller / simpler / more specific than what's on that page.
Added links out to the Apache / Nginx configuration pages in the note at the top of the guide.
| </IfModule> | ||
| ``` | ||
|
|
||
| ### nginx (server block) |
There was a problem hiding this comment.
I think we should link for more information, but that page is far weedier than this block, so I would vote for keeping it here as a quick reference.
|
|
||
| Many people want WordPress to power their website's root (e.g. https://example.com) but they don't want all of the WordPress files cluttering up their root directory. WordPress allows you to install it into a subdirectory, but have your website served from the website root. | ||
|
|
||
| **Note:** This guide covers configuration for Apache (`.htaccess`), nginx (server blocks), and IIS (`web.config`). |
There was a problem hiding this comment.
| **Note:** This guide covers configuration for Apache (`.htaccess`), nginx (server blocks), and IIS (`web.config`). | |
| **Note:** This guide covers configuration for Apache (`.htaccess`), nginx (server blocks), and IIS (`web.config`). For more detailed information see the [Apache / `.htaccess` configuration page](https://developer.wordpress.org/advanced-administration/server/web-server/httpd/) or the [Nginx configuration page](https://developer.wordpress.org/advanced-administration/server/web-server/nginx/) in the Developer Handbook. |
Adds nginx server block configurations to the WordPress subdirectory guide. The current documentation only covers Apache and IIS..
Note:
I only test this configuration in vm but still needs a thorough testing on a real nginx server to ensure accuracy..
#313